package com.wyj.wuliwuli.controller;

import com.wyj.wuliwuli.common.AjaxRequest;
import com.wyj.wuliwuli.common.AjaxResult;
import com.wyj.wuliwuli.common.PageParam;
import com.wyj.wuliwuli.service.WuliFeedbackService;
import com.wyj.wuliwuli.service.WuliNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Version 1.0
 * @Description
 */
@Api(tags = "反馈")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/wuli-feedback")
public class WuliFeedbackController {

    private final WuliFeedbackService wuliFeedbackService;

    /**
     * 参数示例：
     * {
     * 	"data": {
     * 	    "property":"createDateTime",
     * 	    "direction":"ASC"
     *        },
     * 	"params": {}
     * }
     */
    @ApiOperation(value = "分页查询")
    @PostMapping("/page")
    public AjaxResult page(@RequestBody AjaxRequest<PageParam> ajaxRequest) {
        return wuliFeedbackService.page(ajaxRequest);
    }

    /**
     * 参数示例：
     * /api/wuli-feedback/1
     */
    @ApiOperation(value = "根据ID查询")
    @GetMapping("/{id}")
    public AjaxResult getById(@PathVariable Long id) {
        return wuliFeedbackService.getById(id);
    }

}
